/**
 * 系统用户查看js
 */
var chgLogUserLook = {
	key:"ChgLog_key_",
	dataCache : null,

	startEvent : function() {
		chgLogUserLook.showInfoById();
	},

	showInfoById : function() {
		var id= art.dialog.data('lokId'); // 修改id
		
		var key = chgLogUserLook.key + id;
		var record = eval('(' + localStorage.getItem(key) + ')');

		var beforeImage =eval('(' +  record.beforeImg+ ')');

		var afterImage =eval('(' +  record.afterImg+ ')');
		
		for(var i in beforeImage){
			var textBf=beforeImage[i];
			var textAf=afterImage[i];

			console.log("i = " + i);
			console.log("textBf = " + textBf);
			console.log("textAf = " + textAf);


			if (i.indexOf("channelName") >=0){
				console.log("name  = channelName   --- " + i);
				$('#com-addForm td[name="channelName"]').html(textBf);
				$('#com-addForm td[name="channelNameAf"]').html(textAf);
				if(textAf !=textBf){
					$('#com-addForm td[name="channelNameCh"]').html("已修改");
				}
			}else if (i.indexOf("orgName") >=0){
				console.log("name  = orgName   --- " + i);

				$('#com-addForm td[name="orgName"]').html(textBf);
				$('#com-addForm td[name="orgNameAf"]').html(textAf);
				if(textAf !=textBf){
					$('#com-addForm td[name="orgNameCh"]').html("已修改");
				}
			}else if (i.indexOf("insideName") >=0){
				console.log("insideName  = insideName   --- " + i);
				$('#com-addForm td[name="insideName"]').html(textBf);
				$('#com-addForm td[name="insideNameAf"]').html(textAf);
				if(textAf !=textBf){
					$('#com-addForm td[name="insideNameCh"]').html("已修改");
				}
			}else if (i.indexOf("insideDepName") >=0){
				console.log("insideDepName  = insideDepName   --- " + i);

				$('#com-addForm td[name="insideDepName"]').html(textBf);
				$('#com-addForm td[name="insideDepNameAf"]').html(textAf);
				if(textAf !=textBf){
					$('#com-addForm td[name="insideDepNameCh"]').html("已修改");
				}
			}else if (i.indexOf("insidePhoneNum") >=0){
				console.log("insidePhoneNum  = insidePhoneNum   --- " + i);
				$('#com-addForm td[name="insidePhoneNum"]').html(textBf);
				$('#com-addForm td[name="insidePhoneNumAf"]').html(textAf);
				if(textAf !=textBf){
					$('#com-addForm td[name="insidePhoneNumCh"]').html("已修改");
				}
			}


			//if(i=='col25channelName'||i=='col27orgName'||i=='col13insideName'||i=='col14insideDepName'||i=='col15insidePhoneNum'){
			//	$('#com-addForm td[name="'+i+'"]').html(textBf);
			//	$('#com-addForm td[name="'+i+'Af"]').html(textAf);
			//	if(textAf !=textBf){
			//		$('#com-addForm td[name="'+i+'Ch"]').html("已修改");
			//	}
			//}
		}
	},

	init : function() {
		chgLogUserLook.startEvent();
	}
}
$(document).ready(function() {
	chgLogUserLook.init();
});